Together with boolean operations defined in the Part Workbench, the Sketcher Workbench, or "The Sketcher" for short, forms the basis of the constructive solid geometry (CSG) method of building solids. Together with PartDesign Workbench operations, it also forms the basis of the feature editing methodology of creating solids. But many other workbenches use sketches as well.
When a driving dimensional constraint is created, and if the Ask for value after creating a dimensional constraintpreference is selected (default), a dialog opens to edit its value.
You can enter a numerical value or an expression, and it is possible to name the constraint to facilitate its use in other expressions. You can also check the Reference checkbox to switch the constrain to reference mode.
To edit the value of an existing dimensional constraint do one of the following:
Right-click the constraint in the Sketcher Dialog and select the Change value option from the context menu.
Reposition constraints
Dimensional constraints can be repositioned in the 3D view by dragging. Hold down the left mouse button over the constraint value and move the mouse. The symbols of geometric constraints are positioned automatically and cannot be moved.
Profile sketches
To create a sketch that can be used as a profile for generating solids certain rules must be followed:
The sketch must contain only closed contours. Gaps between endpoints, however small, are not allowed.
Contours can be nested, to create voids, but should not self-intersect or intersect other contours.
Contours cannot share edges with other contours. Duplicate edges must be avoided.
T-connections, that is more than two edges sharing a common point, or a point touching an edge, are not allowed.
These rules do not apply to construction geometry (default color blue), which is not shown outside edit mode, or if the sketch is used for a different purpose. Depending on the workbench and the tool that will use the profile sketch, additional restrictions may apply.
Drawing aids
The Sketcher Workbench has several drawing aids and other features that can help when creating geometry and applying constraints.
Continue modes
There are two continue modes: Geometry creation "Continue Mode" and Constraint creation "Continue Mode". If these are checked (default) in the preferences, related tools will restart after finishing. To exit a continuous tool press Esc or the right mouse button. This must be repeated if a continuous geometry tool has already received input. You can also exit a continuous tool by starting another geometry or constraint creation tool. Note that pressing Esc if no tool is active will exit sketch edit mode. Uncheck the Esc can leave sketch edit modepreference if you often inadvertently press Esc too many times.
Auto constraints
In sketches that have Auto constraints checked (default) several constraints are applied automatically. The icon of a proposed automatic constraint is shown next to the cursor when it is placed correctly. Left-clicking will then apply that constraint. This is a per-sketch setting that can be changed in the Sketcher Dialog or by changing the 视图Autoconstraintsproperty of the sketch.
The following constraints are applied automatically:
It is possible to snap to grid lines and grid intersection, to edges of geometry and midpoints of lines and arcs, and to certain angles. Please note that snapping does not produce constraints in and of itself. For example, only if Auto constraints is switched on will snapping to an edge produce a Point on object constraint. But just picking a point on the edge would then have the same result.
Depending on the selected option in the preferences only the dimensional On-View-Parameters or both the dimensional and the positional On-View-Parameters can be enabled. Positional parameters allow the input of exact coordinates, for example the center of a circle, or the start point of a line. Dimensional parameters allow the input of exact dimensions, for example the radius of a circle, or the length and angle of a line. On-View-Parameters are not available for all tools.
Determining the center point of a circle with the positional parameters enabled
Determining the radius of a circle with the dimensional parameters enabled
If values are entered and confirmed by pressing Enter or Tab, related constraints are added automatically. If two parameters are displayed at the same time, for example the X and Y coordinate of a point, it is possible to enter one value and pick a point to define the other. Depending on the object additional constraints may be required to fully constrain it. Constraints resulting from On-View-Parameters take precedence over those that may result from Auto constraints.
Arc created by entering all On-View-Parameters with resulting automatically created constraints
Coordinate display
If the Show coordinates beside cursor while editingpreference is checked (default), the parameters of the current geometry tool (coordinates, radius, or length and angle) are displayed next to the cursor. This is deactivated while On-View-Parameters are shown.
Selection methods
While a sketch is in edit mode the following selection methods can be used:
3D view element selection
As elsewhere in FreeCAD, an element can be selected in the 3D view with a single left mouse click. But there is no need to hold down the Ctrl key when selecting multiple elements. Holding down that key is possible though and has the advantage that you can miss-click without losing the selection. Edges, points and constraints can be selected in this manner.
Double-clicking an edge in the 3D view will select all edges directly and indirectly connected with that edge via endpoints. There is no need for the edges to be connected with Coincident constraints, endpoints need only have the same coordinates.
Sketcher Dialog selection
Edges and points can also be selected from the Elements section of the Sketcher Dialog, and constraints from the Constraints section of that dialog.
The standard keyboard shortcuts, Ctrl+C, Ctrl+X and Ctrl+V, can be used to copy, cut and paste selected Sketcher geometry including related constraints. But these tools are also available from the Sketch → Sketcher tools menu. They can be used within the same sketch but also between different sketches or separate instances of FreeCAD. Since the data is copied to the clipboard in the form of Python code, it can be used in other ways too (e.g. shared on the forum).
Tools
工具
草图工作台工具都位于加载草图工作台时出现的草图菜单中。
Some tools are also available from the 3D view context menu while a sketch is in edit mode, or from the context menus of the Sketcher Dialog.
introduced in 0.21: If a sketch is in edit mode the Structure toolbar is hidden as none of its tools can then be used.
Ellipse by center: Creates an ellipse by its center, an endpoint of one of its axes, and a point along the ellipse. introduced in 1.0: Or by both endpoints of one of its axes and a point along the ellipse.
Construction Mode: 将元素切换 到/从 草图模式。对象草图不会在3D几何操作中使用,并且仅在编辑包含它的草图时可见。这是 v0.15 中使用的图标。直到FreeCAD v0.16,用户必须先在草图编辑器中创建常规(白色)几何对象,然后使用此工具将其更改为“几何草图”(蓝色)。
Construction Mode: 在FreeCAD v0.16中,添加了在构造模式下直接创建几何的能力,因此图标已更改为该图形。选择现有的草图编辑器几何图形,然后单击此工具可以在常规和构造模式之间切换几何图形,就像以前的FreeCAD版本一样。从FreeCAD v0.16开始,当没有选择草图编辑器几何图形时,选择此工具会更改将要创建将来的对象的模式(常规与构造)。
Dimension: Is the context-sensitive constraint tool of the Sketcher Workbench. Based on the current selection, it offers appropriate dimensional constraints, but also geometric constraints. introduced in 1.0
Horizontal distance: Fixes the horizontal distance between two points or the endpoints of a line. If a single point is pre-selected, the distance is relative to the origin of the sketch.
Sketcher Lecture by chrisb. This is a more than 80 page PDF document that serves as a detailed manual for the Sketcher. It explains the basics of Sketcher usage, and goes into a lot of detail about the creation of geometrical shapes, and each of the constraints.